//
// Created by hugan on 2021/8/30.
//

#ifndef HUP_UTILS_PARENT_CPP_MOUSEUTIL_H
#define HUP_UTILS_PARENT_CPP_MOUSEUTIL_H

#include <Windows.h>

/**
 * 鼠标工具类
 * https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendinput
 * https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-mouseinput
 */
class MouseUtil {
public:
    /**
     * 移动鼠标
     */
    static WINBOOL move(int x, int y);

    /**
     * 模拟滚轮滚动
     * @param value 滚动n个单位的距离,取值非零整数:小于0表示向上/左
     * @param isHorizontal false-竖直滚动;true-水平滚动
     */
    static int wheel(int value, bool isHorizontal);

    /**
     * 显示鼠标; 解决开机/重新登陆时,不移动物理鼠标时,系统不显示鼠标光标
     * 详见测试方法 testMouseCursor()
     */
    static WINBOOL showMouse();
};


#endif //HUP_UTILS_PARENT_CPP_MOUSEUTIL_H
